Last time I did this for myself (in 1991) it cost me $20k. In about 2006 I helped someone else do it, he said it was under $10k all total. I think the cost went down as a response to pressure from Intek (ETL). It may have gone down more since then, I don't know, but it's still a fairly big financial commitment for a part-time retirement endeavor.
Left off of Bob's otherwise accurate description of the process is that in order to get your final listing, you need to build panels for UL to inspect. That means finding a customer willing to pay you to build panels that might not end up listed, and/or wait for them as you schedule an inspection by UL. That's a lot trickier to put together in real life than it sounds on paper.