Devkitpro is a compiler for various flavours of the C language family and assembler for various consoles, but the Switch is included among its targets.
It will compile in much the same way as most unix/GNU compilers and assemblers, because it is mostly them underneath it all. Don't know if anybody has made a nice way for it to interface with code blocks or anything like that.
Anyway in the folders there will be some examples of using various libraries, and there are a handful of open source games as well. Have never tangled with dkp switch libraries for 3d (which probably will resemble opengl more than out and out custom or directx approaches to the world as the underlying hardware is mostly that) but will probably be examples and open source implementations you can look at there.