I've finished a quick and dirty implementation of a script which calculates unlock codes ("NCK") for Huawei modems:
The algorithm has been published a while ago, and there are a lot of other tools out there which do just the same thing. You need python 2.x to run the script.
This is a list of devices for which the unlock code ought to work:
Huawei: E156, E155, E1550, E1552, E156G, E160, E160G, E161, E166, E169, E169G, E170, E172, E176, E1762, E180, E182E, E196, E226, E270, E271, E272, E510, E612, E618, E620, E630, E630+, E660, E660A, E800, E870, E880, EG162, E880, EG162, EG162G, EG602, EG602G
Vodafone: K2540, K3515, K3520, K3565, K3520, K3565
A method to unlock the popular E220 devices has been published here.
Update 5/9/2011: Neil McPhail has put together an automated unlocker script for Linux.