First, figure your true cost per hour to provide whatever the service is. This means you have to compute the incremental cost of every employee, something you really should have available all along anyway. This includes not only the salary, but medical insurance, FICA, state unemployment tax, federal unemployment tax, and possibly even part of your property insurance. A part of our property insurance premium is proportional to payroll, for example. Also include the slice of management required for that employee all the way up the chain. Make sure to divide the employee's cost by true working hours, which is after vacation and holiday are taken out of the work year. I subtract out a fraction of the remaining hours for inefficiency. No employee will spend 100% of the available time on a paying project. There are inevitable internal things to do on occasion. I usually use 6 hours per working day for the applied-to-project $/hour estimate.
Once you have a pretty good idea of your cost per hour, add in a reasonable profit. I try not to be greedy, so start at $25/hour profit minimum, although for some tasks and people I can make it higher or a percentage. But $25/hour is the minimum profit I'm going to bill someone out at. Actually all this and some additional judgement goes into deciding your billing rate. You should always have this ready anway, so the above is really homework you should have done long ago and keep current when things change. For example, I've done all this and decided our billing rate is currently $130/hour. I don't have to go thru the details every time a customer asks. I do re-evaluate this once or twice a year, or when expenses change in a significant way or I think the market has changed.
Next you have to estimate the job. Only experience can help here. Most people grossly underestimate how long something will take, or tend to forget details that add up. Don't forget time to interface with the customer, shipping, time to go to a subcontractor site to see what they screwed up, etc.
After the *realistic* estimate, you give the customer two choices: time+materials or fixed price. Most customers, especially unsophisticated ones, will immediately jump to fixed price. It's natural since they don't know you and want to protect themselves from you taking them for a ride. However, this is where I explain how fixed price works. With fixed price, I'm taking the risk, so expect to get paid for that. I tell the customer very honestly how all this is computed. My minimum markup for fixed price is 1.5 times the estimate, more for higher risk things. I also insist on a clear spec.
For example, we recently had a large fortune 100 company you would recognize ask us to bid on a dsPIC firmware developement job. There are a lot of little things the firmware needs to do that don't sound like much on the outside, but represent major work on the inside. They really wanted fixed price. We sat down and did a estimate internally from the information we had, added significant padding to things that we felt were risky or not well specified, multiplied that by our billing rate, and came out to $90-100k. We told the customer the guaranteed fixed price was $150k, but that we think it would cost them $90-100k if they went the time+materials route. They decided T+M was a better idea after all, and awarded us the job.
Now I'm going to disagree with Todd. Don't worry what you think the competition is charging. Looking over your shoulder is a waste of time and a distraction. Price the job so it makes sense for you with a fair but not outrageous profit. Sophisticated customers will understand that, and most likely your cost won't be all that much different from their fully burdened internal cost. Again, sophisticated customers will already have that figure to compare your cost against.
In any case, just like you shouldn't look over your shoulder, don't try to compete on price. If it was strictly a price issue, they'd hire someone internally to do it. They are going outside to get expertise they can't get on staff, or don't need enough of regularly to keep on staff.
When you go for the initial interview (sales call), you need to make sure they know your rate up front, but otherwise the discussion should be about their project. You try to really get into and uderstand the project, and make intelligent comments and suggestions as much as possible. Consider yourself a engineer on the project at that time, and give them honest opinions and advice accordingly. Never be afraid to "give away" some information. If you tell them something in a 2 hour meeting such that they can do it themselves, then you wouldn't have added much value and the project was doomed to make you look bad anyway. I've always found that being as helpful and insightful in the initial meeting makes a very good impression with the prospect. I always try to get such a face to face meeting with the technical people. We pretty much always get the job (if we want it) as a result of such a meeting.
The recent job with the fortune 100 company was one of those. They made it clear they were doing their homework and investigating several outside people or companies to do this. We dug right in to the project at the meeting, made a few recommendations about the schematic, warned them of some possible pitfalls with the dsPIC they chose, and otherwise made them feel comfortable we knew what we were doing, had done similar things before, and were ready to help. I rather doubt we were the lowest bidder. In fact, I hope not else we didn't price it right.
As a consultant you are selling specialized expertise, and sophisticated customers don't buy on price within reason. You get the job by convincing them you're the best, not the cheapest. In fact if you're too cheap they'll wonder whether you really are that good. I've had customers tell me after we got that the job that we were actually the highest bidder. That's what I love to hear.
There are two corrolaries to this. First, if you don't have special expertise to offer, don't try to be a consultant. You'll lose your shirt or end up getting paid dirt selling engineering services as a commodity. Second, chose your customers carefully. A unsophisticated customer that is only worried about the price will always think you're taking them for a ride and never be happy. They will be a aggrevation, unpleasant to work with, mistrusting, wanting concessions, and at best won't be useful referrals. No thanks.
For example, we had a guy in here a few months ago that wanted a certain gizmo designed. He thought he knew all about how to do it, but didn't want to for some reason (I'm pretty sure because deep down he knew he was in over his head). He came in expecting a certain price which was unrealistic. He wanted minute control over every detail, and specified certain things that didn't make sense. When asked why it had to be this way when there were other ways to acheive his stated goals he got irritated and defensive. He also made it clear he was shopping this around and claimed others had already given him a lower price. We didn't say no outright, but just let it slide. We returned his calls and emails, but didn't persue it. Eventually he went away on his own without us having to push him away, which was the best result possible under the circumstances. Some inexperienced engineer is probably only now realizing he's not making any money on that job, and he's stuck with a pain in the butt customer for no gain. That's what happens when you don't know what you're doing. You don't want to be that schmuck.