Software cost estimation is huge topic (and a very complex one). Here is the basic premise for all of them.
- You have a large specification, it is impossible to estimate the work required for all of it.
- Break the specification into smaller tasks.
- Classify the tasks into complexity and risk. (Es things which need to integrate with a third party software have a higher risk.)
- A task should not be larger than one day. If it is, break it into subtasks to make it smaller.
- As complexity or risk in increases, add contingency to plan for it.