If it's a lackberry*, you just need a code. People sell them on eBay, that's how I got mine.
Find someone with a stellar seller rating, buy an unlock code (I think mine was a buck), then they get you to email them a code from your phone, and they email you back another code and some instructions. Easy-peasy.
I think that there must be some sort of code-generator/algorithm, based on a unique ID from your phone, that generates the unlock code. Something that small-scale IT companies can buy from Apple/RIM/Google, and then sell the output of.
*That's a typo, but given my feelings for my phone right now, I'm leaving it as-is.