It's currently illegal in America to unlock a cell phone on your own, by hardware or software means.
Carriers will supply an unlock code upon request following a fulfilled contract.
Or, if you bought the phone out right you can usually get a code from the carrier it's locked to a for a very small fee.