If you must do this, it is possible with tikzmark
. But watch out that you choose an appropriate escape character, which is never used in the listing itself.
I would not recommend it though. It requires manual edits to your listing source, which may or may not be feasible, depending on the length of the listing. There are also better, clearer ways to explain source code than this.
\documentclass{article}
\usepackage{listings,tikz}
\usetikzlibrary{decorations.pathreplacing,tikzmark}
\usetikzmarklibrary{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
\begin{lstlisting}[language={[LaTeX]TeX},escapechar=|]
|\tikzmark{mark1begin}|\documentclass[<options>]|\tikzmark{mark1end}|{|\tikzmark{mark2begin}|<class name>|\tikzmark{mark2end}|}
\end{lstlisting}
\begin{tikzpicture}[overlay,remember picture]
\draw[overlay,decorate,decoration={brace},yshift=2ex]
(pic cs:mark1begin) -- (pic cs:mark1end) node[midway,above] {[illegible]};
\draw[overlay,decorate,decoration={brace,mirror},yshift=-0.3em]
(pic cs:mark2begin) -- (pic cs:mark2end) node[midway,below] {[illegible]};
\end{tikzpicture}
\end{document}

tcolorbox
for quite nice listings. – user31729 Oct 6 '14 at 12:12