Some dealers will charge, yes. Some won't.
The one's that don't charge are getting fewer and further between.
They can get the code based on your VIN (assuming it's the original headunit), or the serial number off the case.
If you're lucky, the code will also be printed on a removable card in the owner's manual. Some folks have also been able to find it on a sticker around the spare tire well (but my sticker, like a lot of other people's, is missing).
Basically, you get the code... which I believe is a 4 or 5 digit number... then you go to your headunit and press the SCAN button (I think it's the scan button) which will enter the unit into a mode to input the code. You enter the code by pressing the first station button to cycle through numbers on the display until it matches the first digit of the code. Then move on to the second station button to cycle through the second digit of the code, and so on and so on. Once you have all the digits of the code entered, you may have to press the SCAN button again. But then your radio should be out of safe mode and fully operational.