I'm aware that nobody actually does this at the hobbyist level, that successful commercial products have been launched without certification, and it's probably something I can't afford if I have to ask. However, I've always wondered about the ballpark cost. About how much does it cost to receive FCC certification?
As a rough estimate, the cost is $10k-20k, plus your labor cost.
In the US, all products containing electronics that oscillate above 9 kHz must be certified. The law that governs this is FCC Part 15. The lawyers call this "Title 47 CFR Part 15," meaning that it is the 15th subsection of the 47th section of the Code of Federal Regulations. In Europe, there is a similar regulation called CISPR 22. The requirements are almost the same, but slightly stricter about emissions at certain frequencies.
You can read 47 CFR 15 online. It's not as incomprehensible as you might expect. It seems overwhelming, but if you read the first few PDF's, you'll realize that most of it irrelevant for any single product.
Within 47 CFR 15, there are two classes of testing: Class A and Class B. Class A is an easier test to pass, intended for devices that are used in industrial settings. Class B is stricter, intended for devices that are targeted at consumers.
There is additional testing for "intentional radiators," meaning radios, Wi-fi, Bluetooth and such. There may be an exception if your device is intended for use as a component in a larger system (like a microprocessor or memory card in a PC), but I'm not sure of the legal details there.
The major expense is renting the test chamber. This is what's called an "anechoic chamber," instrumented with a pile of sensors for detecting electromagnetic radiation. To my knowledge, these cost around $1000/hour, and each testing session takes 2 or 3 hours. It's unlikely, but not impossible, that you will pass on the first try.
Unless you're experienced with emissions testing, it is worth hiring an expert, which costs around $500/hour. They can tell you things like, "Put a ferrite bead on that power cable, and that will reduce the emissions at this frequency." The folks I've worked with arrive with a bunch of ferrite beads and inductors (and maybe caps?) of various sizes that you can use in the chamber to hack your device into compliance.
(Perhaps it goes without saying, but I'm an engineer, not a lawyer. I have taken a few products through Part 15, but not in the last couple of years.)
If you're thinking about doing this, start by reading EMC for Product Designers by Tim Williams. I'd avoid the books by Mark I. Montrose; I found them less helpful and more expensive.
About five years ago I got a product CE tested for $7500. The testing house provided advice, and they retested until it passed as part of the upfront cost. It passed on the second attempt (barely). Since, I've read High-Speed Digital Design: A handbook of black magic several times until I mostly got it and I probably won't have nearly as much trouble in the future. I highly recommend the book.
Where I used to work we saved a lot of money on CE testing by hiring the facility for half a day and doing our own preliminary testing. We fixed any problems, they were usually quite minor, and the equipment always then passed first time. You do need to have someone who knows how to drive the test instruments, of course.