i'm pretty much just gonna echo pretty much what everyone else is saying but...
At&t will never unlock your iphone (assuming you live in the us), but if you live somewhere else, try giving your carrier a call to see if they'll do it before you go messing around with anything.
If they won't unlock you, you will need to use something called a gevey sim to unlock you, as your baseband is not currently software unlockable.
When the ios 5 upgrade comes out, you will need to be careful because if you upgrade, your phone will no longer accept the gevey. You can, however, upgrade to ios 5 and keep your unlock by creating a custom ios 5 firmware. We will get to that when the time comes. :d