The best way to unlock modern iPhones using the most recent Apple firmwares is to use RedSn0w. Here is a guide for unlocking the 2G iPhones (such as mine). If you want to unlock a 3G or 3GS, you need to jailbreak the phone first using RedSn0w, and then unlock it using UltraSn0w, the unlocking tool for iPhone 3G.
This is my experience with getting an iPhone working with Ireland’s Meteor network. Currently the iPhone is only available from O2, and only with an 18-month service contract. I have been using a simple, pay-as-you-go plan from Meteor and wanted to use that in an iPhone.