1.) Obtain 2 iPhones
2.) Plug in iPhone #1 In iTunes select “I am a new AT&T Wireless Customer” and “Activate 2 or more phones on an individual or FamilyTalk Plan.”
3.) Follow the steps for the FamilyTalk plan and enter “Cell Number X” to port a number over from another provider (e.g. Sprint)
4.) When the you receive the “Activation Complete” e-mail, plug in iPhone #2.
5.) Select the option “I am an existing AT&T (Cingular) wireless customer” and “Replace a phone on my account with this iPhone”
6.) Fill in the information re-using “Cell Number X.” Allow the iPhone #2 to activate using this number. This number will be legit.
7.) Plug in iPhone #2, it will unlock the phone for use, but without a cell phone number assigned or account from AT&T

Alternatively:-

Download:

http://www.deadbeef.cn/files/anySIM.zip
PXL Package:

http://iphone.exploit.org/pxl/anySIM.pxl (allows direct installing from the web in MobileSafari if you’ve already installed the PXL plugin).

Mirror:

http://www.weputit.com/files/iphone/anySIM.zip
http://iphone.doggunn.com/anySIM.zip
http://engadget.com/videos/anySIM.zip
http://iphonedev.km20825.keymachine.de/anySIM.zip
You’ll need a tool like iBrickr (for Windows) or iFuntastic (for Mac) to install the app on your iPhone.

However, here are some things you should be aware of:-

Apple will break the unlock in the next update. Both the software and hardware unlocks appear to rely on hacks to firmware for the baseband, the chip that talks to the cellular network. This firmware has already been updated once, and there are strong hints that it will be updated in the next firmware release which will come very shortly.

Apple will break the unlock in the update after that. The software unlock relies on a buffer overrun bug in the main iPhone firmware. This kind of bug is often a security problem, and will likely be patched when they release features or fix other bugs.

Apple will keep releasing new features. Sure, you can pass up software updates, but how long will you be able to hold out as Apple keeps on rolling out new things?

It is very likely that Apple will release an iPhone update within the next few weeks when they roll out the mobile version of the iTunes store, it may even come as soon as this Tuesday, when they are expected to announce European iPhones, this could relock your "unlocked" phone and who knows how long it will take to unlock again.