Mortgage broker here - some charge fees, others do not. If you use a large company with many brokers, chances are they may not charge any broker fees becasue if that particular mortgage is unsuccessful, they can soak up the loss (time spent). If you use an independent, whole of market broker, they may well charge a fee. As a Pp said, they're normally payable on completion and usually the more complex the case (adverse credit, debt consolidation etc) then generally, the higher the fee. Purely becasue of how long it can take.
The fees from the lender are know as 'proc fees' and can range from £40 - £000s dependant on the case. A broker charging a fee ensures a steady income stream. If they have 10 x £40 fees in a month, its barely going to cover heating bills today!
In all cases, it is set by the Financial Conduct Authority that a broker MUST disclose all fees. You will find that information on your ESIS (the paperwork which sets out costs, charges, Lender, term, charges etc etc). You can ask for this from your broker. If they refuse, its just not very good practise and I'd suggest going to someone who is willing to spend time with you.
I'd also ALWAYS recommend using a broker rather than direct. They'll normally have access to most major banks, building societies and other lenders and can literally check the 'whole of the market'. Saves you the job of going through all your information again and again and again...
Hope this helps!