
After installing Blackra1n latest version, you get option to install Cydia, Rock and Sn0w.Once you install, simply reboot the iphone and thats it your iphone is unlocked.
You can download BlackSn0w(included in latest version of BlackRa1n) from BlackRa1n.com
For step by step procedures for unlocking iphone 3GS visit this site.