I have a couple of code projects in C++/Python in which LaTeX-format descriptions and labels are used to generate PDF documentation or graphs made using LaTeX+pstricks. However,
Try detex (shipped with most *TeX distributions), or the improved version: http://code.google.com/p/opendetex/
detex
Edit: oh, I see you tried detex already. Still, opendetex might work for you.