For examples supplied here and in other forums, I use a directory structure with one example per directory, in a parent directory per forum.
Each directory has a short README text file explaining the example (and if I remember, an URL to the relevant post).
These do not need version control per se, but since I already have hundreds of them, finding relevant ones becomes the task to speed up.
I can throw a find or grep command in a few seconds to prune the set down based on a few key words I might remember, but to verify I have the correct example without reading the README or the source code itself, I add an Usage info block to each executable, telling me what it does as succintly as I can manage. This way, I just run the executables in the candidate directories without parameters (or with -h or --help), to see if I've found the relevant example. I've found it even helps when writing the code: it outlines the needed functionality before I write it.
For development of actual projects, for version control, I too use git.