Highlight 2.2 is a nice utility that will convert your code into colored output in HTML, XHTML, RTF, TeX, LaTeX, XSL-FO and XML format.