I was looking for something similar, code that uses llvm libraries, and after long session in google I just found it in the llvm website under "llvm projects": http://llvm.org/ProjectsWithLLVM/
just download what you think relevant for you and play along.