Luckily, T-mobile gave me the unlock code to my first GSM phone. I had to enter a special code that they emailed me, and enter a password and that was it. T-Mobile I think is one of the few carriers in the US that allows this(They want you to use your T-Mobile phone overseas too on their networks there). My t68i was a great phone, but it actually lacked one of the frequencies used by North America, especially in rural areas.. Worked fine in the city... I also am a Cingular, Pay as you go customer... I just need to pop a different SIM card in, and I'm on Cingulars network. I have found this handy in a few dead spots up in the mountains.
My k790a unlocking was a bit trickier. I really got hooked on Sony Ericsson's phones, they are loaded with really useful features.. This one has a 3 megapixel camera and loads of other features. One problem, this phone was only available in Canada, and it was locked to a canadian carrier. So I bought it off ebay, locked, it was a few hundred dollars cheaper than the unlocked version.
Then the fun begins, I still had my t68i but one of the buttons started to act up.. I got a new Blackberry Pearl from T-mobile, wait a few weeks and unlock it, sell it on Ebay brand new, and it all comes out in the wash as an upgrade to the phone I actually wanted, not the one the carrier is pushing to sell.
Unlocking the k790a took a bit of research... If you are not technical, have one of your tech friends do it or visit any non-carrier gsm reseller and pay a guy to do it. The phone came with a USB cable, so that was key, I knew I could somehow use my computer to unlock it. I used Davinci Teams software to unlock it, and Mobile2Mobile.net's software to unbrand it.