Hey guys, I live in France currently and I purchased my iPhone 4 here through Virgin Mobile locked. After 6 months with the company if you call them to unlock it they will unlock the phone for free within 2-3 days. I used some of the advice on here along with mine. This is what I did at it worked flawlessly:
1. Call your mobile provider and ask them to unlock it after 6 months of continous contract. (they will tell you to wait about 2-3 days if you live in Europe and if you live in the States, it's right away)
2. Back-up iPhone on Itunes
3. Settings > General > Reset > Erase All Content and Settings
***** VERY IMPORTANT > DO NOT RESTORE FROM BACK-UP, if you do it won't work.
4. Restore > iPhone. Don't choose the last backup, but the first thing of the list which says iPhone. This will set it up as new.
5. After set-up is complete, take out YOUR Sim Card and try it with another one from Another phone company.
In my case I used Free (Phone company in France) and after 30 seconds of Searching... it worked.
6. Last step is to insert your current card if you still plan on using the same one till you travel over-seas or switch companies, AND
7. Back-up from last Back-up and everything will be back safe and sound.
For some people "Congratulations your iPhone is Unlocked" it shows, for me it didn't and it still doesn't. Not to worry, the best way to check is with another Sim Card