If you are using the GNU compiler g++ you can create and display coverage data rather easy. All you have to do is to add the following compiler flags to your projects settings when creating a debugging version:
This will instrument the compiled binary. After running your application you need to convert the coverage data into a format that is supported by Hudson. There are several plugins available but the Cobertura plugin covers conveniently everything I need.
Here is a snippet from one of my projects: it changes into the topmost build directory after all the unit tests have run. Then the Python script gcovr invoked with the option --xml recursively collects the data and transforms everything into an XML file for Cobertura.
gcovr relies on the GNU tool gcov which creates a simple text file from the pure coverage data in an intermediate step. Basically this is all you need to know about gcovr. There is a short manual if you want to know more.
Of course you need to enable the Cobertura plugin in your Hudson project and enter the above path to your XML file.
The GNU tools support both line coverage as well as branch coverage.