Call T-Mobile and tell them you need the code, As long as it's been active for 60 days they will give it to you. I've yet to see somebody other than them unlock a MyTouch4G.
T-Mobile's Unlock FAQ:
http://support.t-mobile.com/docs/DOC-1588
It took 2 days for me to get it from them, the request is quick then they email it to you.