Eclipse CDT is a free C/C++ IDE which has a key combination (Ctrl+Shift+O, IIRC) which will remove unused #include and add those which are missing.
Most modern compilers (such as GCC) will wantwarn you of unused parameters.
As a general topic, look at static code analysis tools, such as Lint .
See also (list of free static code analysis tools).
I recommend the free Splint, but there are many more