The firmware password is stored in the firmware. The firmware is located in a chip or series of chips on the main logic board. It is not stored on a hard drive and thusly switching hard drives will not work.
If it is a Mac that predates 2010 or 2011 (I honestly forget which off the top of my head), you can reset it by turning it off, altering the RAM configuration and then turning it back on again. If it is a Mac from 2011 or newer, then as others have said, your only option is taking it to Apple.
You can change the password if it is from 2009 (maybe 2010 too) or earlier. Your comment is correct for 2011 and newer Macs.