When I looked into this some years ago I was unable to find a definitive English grammar answer. As what I finally decided on is also used by major code organisations (i.e. Apache) I feel confident I made the correct decision: treat code as <code>.
<p><code>.htaccess</code> files provide a way to make configuration changes on a per-directory basis.</p>
The monospace <code> nicely differentiates the non-dictionary code term from the rest of the sentence. And it is nice semantic markup. Use CSS to spice to taste.
Adding the 'title' attribute or a link to a glossary definition can be nice touches that also emphasise the difference and importance of the term.
I'd agree with Nutter. That's how scientific stuff is handled: "p53 expression was reduced..." Also names: "von Hippel-Lindau syndrome predisposes to..."
The bottom-line rule in punctuation and grammar is always "clarity above all," and I think that applies here. If something is meant to be lower case, there's probably a reason, and to capitalize it could be confusing. This would also keep me from using italics in place of capitalization; in the paragraph above, if I wrote "p53..." it would have a different meaning in genetics lingo.