As part of SQM 400 we had to build a software estimation tool. Our's used feature points, a modified version of COCOMO II and PERT to produce an estimate of the time required to complete a software project. You can find the pdf here
On a similar note, there is a tool called sloccount which will count the number of lines of code in a source directory and produce estimates for effort, time and cost.