Your first port of call for full example code should be the MOOS V10 Tutorial this has a goodly number of full source code examples. The links below may also be useful but the ones in the tutorial will be the ones that are updated most often
To build the code you will need to have download and install core-moos. Instructions on how to do that are here.
You can download the tutorial and all the examples programs in it from github by doing the following
In-place builds are filthy things so we won't do it. Instead make a sibling directory called "build" and move into it
Then run ccmake pointing to CommsExamples (if that is the set of examples that interest us) sub-directory of the examples-docs-moos you created when you cloned the documentation and examples project:
Then actually build the code.
you should see an output like this:
which means all the examples are now built and living in the "bin" directory. Happy.