If you're already a T-Mobile customer, and if the blackberry is a t-mobile branded blackberry (and sometimes if you're out of contract), call them and ask them to send you the code. It has worked for me before. If the phone isn't yours', ask the previous owner to unlock it for you. They'll do it for you for free.
If you can't get it done for free, check out this site to get your phone unlocked for a nominal $9 fee.
http://www.blackberryfaq.com/index.php/How_do_I_unlock_my_BlackBerry%3F
For more mobile news and advice, bookmark and read www.wannabetechie.com