I tend to use vim + gdb when I need to trace execution/watch variables. I've never used visual studio, but it would seem it's (erroneously) trying to run cmake over the code. Anything in a 'download' folder isn't actually used at all and is only there for"reference", apparently, so you can safely delete it (that sounds like a good idea actually).
I have no idea why the endings are .txt either. Most of the C stuff was written in notepad, so I guess convenience of windows file associations might have something to do with it?
As you may have discovered, libqb.cpp contains the bulk of the runtime. As a general rule QB subs and functions are mapped to a similarly named C function with a sub_ or func_ prefix (though the string manipulation ones tend to begin qbs_ and a few graphics ones have qbg_ iirc – consistency is not the name of the game here).
I'm not really sure where to start explaining things, but feel free to ask as many questions as you want. If you want rapid fire answers come talk with me on irc sometime.
Finally, don't be too concerned if you're not too sharp with C++. All of the code is just written as if it were C, and here's a dirty secret: C is just BASIC with pointers and punctuation instead of the english-like words.