I have been charging $10/hr for general work, diagnosis, etc. If I have to drive to a site, I count the drive time against the charge, and I require a two-hour minimum. This is for residential customers. For business customers, I would charge $50/hr. But I don't really go after business customers, I'm not certified in servers and networking, although I would like to be. I generally service the "poor", more or less, who have older computers, and can't afford to get a brand-new cutting-edge one, although I would be more than happy to help build one of those for them.
Other things, I charge a flat fee. HD upgrade (including cloning the old disk to the new one) = $50. Reformat and re-install, including all service packs, drivers, and some freeware added on = $50. Backup of old data is extra. I charge for parts, obviously, and I mark them up as appropriate. For example, I bought some ram for $30 a stick, but it was labeled $40. So I charged $40 a stick. HD labeled $80, paid $60 on sale, so I charged $80. Easy things like RAM updates or video card updates or whatever I charge a flat fee of $20 or so. (Figure I'm making some profit on the parts though too.)
Malware removal is by the hour.
Most of the time, if they have a problem that I cannot fix, I don't charge them (except for any parts).
I do work for my immediate family for free. Friends, I charge, sometimes. It depends.
I also have a small circle of clients that I've either serviced, or sold computers to. If I can solve a problem over the phone, I don't charge.
For computers, I charge $100 over the cost of the hardware to build/install it. ($50 for physically building and testing, and $50 for the OS install, updates, etc.) I give an informal hardware-only warranty of one year for the computer. Software problems get charged for.
OH, and this is important - DO NOT sell computers on an installment plan. It takes forever to get your money, and some customers will stiff you.