To avoid the combination of two < or > to « and » place a {} between them:
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\texttt{<{}<test>{}>}
\end{document}
They are combined using the ligatures mechanism. So disabling this one e.g using microtype s \DisableLigatures would also work, but isn't recommended because it reduces the overall typeset quality.
You could also use \verb to typeset the <</>> verbatim. (There is also the shortvrb macro which allows you to make this shorter.)
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\verb|<<|\texttt{test}\verb|>>|
\end{document}
If the content is only text without macros etc. you can use one \verb:
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\verb|<<test>>|
\end{document}
Using shortvrb:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{shortvrb}
\MakeShortVerb\|
\begin{document}
|<<|\texttt{test}|>>|
|<<test>>|
\end{document}
\documentclass{article}\begin{document}\texttt{<<Hello>>}\end{document}works fine, you're probably loading some other package which changes the<<to«. – Juan A. Navarro Feb 24 '11 at 10:42\verb|<<test>>|, aren't you? It will not work well inside macro arguments. – Martin Scharrer♦ Feb 24 '11 at 11:04\verbto write the<</>>as verbatim in\ttfamily. So\verb|<<test \macro>>|will produce<<test \macro>>. If you want to avoid the content being typeset verbatim use:\verb|<<|\texttt{test}\verb|>>|. As said this doesn't work inside macro arguments etc. – Martin Scharrer♦ Feb 24 '11 at 11:19