The tool that seems to be most widely used for this is Doxygen.
It doesn't take all comments - you have to specifically tag the comments that you want to become part of the documentation. After all, you probably don't want every single comment in your code to wind up in the documentation. And it produces some very nice, hyperlinked HTML files.
@MediumSolid
You wanna make a programme of that sort or you want an alreafy existing one? then i also recommend doxygen. Many libraries use it to make .chm files(API documentation).
If you want to create one, you'll need file streams. It's actually not difficult.