I'll try to help solve your problem more than answer your question.
There are many systems for estimating software costs in advance. Why isn't there only one? Because there isn't one that actually works. A comment mentioned COCOMO-II, which I believe claims to be accurate within a factor of 7 times either way! (that's from memory, I can't find a reference, so take it with a grain of salt).
You won't be able to give a client an estimate with a multiply/divide factor of 7.
So, what do people really do?
- Bid conservatively and usually lose the contract.
- Bid aggressively and lose money most of the time.
- Talk the client into not doing fixed-price bidding.
- Bid aggressively then make up the money later.
Item 4 bears explanation. The most common tactics are:
- Do nothing not in the requirements. For example, code quality is rarely a requirement. Training is frequently not a requirement. To be fully complete, a spec would be a working program, so vital things not in the spec can almost always be found.
- If asked to do anything not in the requirements then that gets billed hourly, usually at a high rate.
- Usually bugs have to be fixed. So every bug gets classified as "by design".
This is why many fixed price projects are an unending battle between the parties. How bad it gets tends to be based on how much money the contractor is losing, how greedy the contractor is, how greedy the customer is, and how far behind estimate the project is.
If the process goes well (which can happen, even if I'm not making it sound that way), items in the spec that are difficult to implement can be traded for items that were forgotten, the ultimate price (initial fixed price spec plus all the stuff nobody thought of) is fair, and everyone is happy.
If the process goes badly, what is actually implemented is based on what is on the original spec plus the result of political battles over money, and somebody loses money (probably everybody).
In managing a project, if you won't bend on price, time, or features, but you can't control quality, guess what usually suffers? The fixed price bidding process eliminates at the start the possibility of bending on price or features, and is generally strongly against bending on time. You sound like you would like to be fair and do a good job, but understand it's a tough model to work under.