I experienced the error "Failed to connect to device as it is pin locked." while deploying a Windows Phone 7 application onto my Samsung Focus phone. The solution was:
1) Login to your apphub account at http://create.microsoft.com/
2) Click on your profile name in the top right-hand corner of the screen
3) On the page that displays next, click on the "devices" link.
4) Delete the device that you are not able to deploy on. In my case, I just had one device.
5) Close the AppHup page
6) Start Zune
7) Register the phone using the following application: Start >> All Programs >> Windows Phone SDK 7.1 >> Windows Phone Developer Registration
8) Go back into Visual Studio and deploy your application into the phone device.