
Here are the instructions on how to unlock the iPhone 3GS and iPhone 3G with UltraSn0w for use with any GSM cellphone carrier.
Before following these instructions you must have jailbroken your iPhone and must be on the 04.26.08 baseband (modem firmware). This means that you must be running the 3.0.1 firmware and must have used RedSn0w to jailbreak it.
So how can you find your firmware and moden firmware (baseband) version? Simply follow follow this tutorial.
If you are NOT on baseband version 04.26.08 you need to follow follow his tutorial before unlocking.
First of all, click on "Cydia" on your springboard.

Select the "Manage" tab at the bottom of the screen.

Click "Sources" in the middle of the screen.

Click the "Edit" button in the top right-hand corner of the screen.

Click the "Add" button in the top left-hand corner of the screen.

Enter the source http://repo666.ultrasn0w.com and click the "Add Source" button.

When the source has been added, simply click the "Return to Cydia" button.

Now click the "Done" button at the top right-hand corner of the screen.

Click to select repo666.ultrasn0w.com from the list of "Entered by User" sources.

Click "ultrasn0w" in the list.

Click the "Install" button at the top right-hand corner of the screen.

Click the "Confirm" button at the top right-hand corner of the screen.

After the installation is finished, click the "Return to Cydia" button.

All that's left to do is switch your iPhone off completey by holding down the "Power" button for 3 seconds and "slide to power off".
All that's left to do is switch your iPhone back on, insert your SIM card and place your phonecall :-)

