I just want to introduce a new tool that I met recently. Its the CppDepends! its a wonderful tool which can do static code analysis and generate lot of metrics. It has got CQL( Code Query Language) by which you can write sql like queries to get code metrics.
Have a look at the complete feature list. You can download the tool from here. I think its worth a trial. Try it!