If this is for T-Mobile USA:
simply search for "HTC HD2 T-Mobile unlock code" on ebay. I unlocked mine for US$8 i think. When ordering, you have an option to type in a message to the seller. Type in the Carrier name (e.g. Tmobile USA) and the IMEI number, which you can find on the phone settings software or behind the battery.
It's a very simple process and I received my code by email within a couple of hours following payment.