Customizing the list of listings generated by \lstlistoflistings?

You have to register the list of listings to tocloft; I've found this to work

\makeatletter
\begingroup\let\newcounter\@gobble\let\setcounter\@gobbletwo
  \globaldefs\@ne \let\c@loldepth\@ne
  \newlistof{listings}{lol}{\lstlistlistingname}
\endgroup
\let\l@lstlisting\l@listings
\AtBeginDocument{\addtocontents{lol}{\protect\addvspace{10\p@}}}
\makeatother
\renewcommand{\lstlistoflistings}{\listoflistings}
\renewcommand{\cftlistingsfont}{\itshape}

The last line is just to show that commands of the type \cftlistings... are available for customizing the entries' appearance exactly in the same way as the normal ones.

The "slightly higher up" business depends on the fact that the standard classes issue \addtocontents{lof}{\protect\addvspace{10\p@}} and the same for lot; so we do the same for lol.

You can typeset the list either by \lstlistoflistings or \listoflistings.

FOR memoir

When memoir is used, one has to act in a slight different way

\begingroup\makeatletter
\let\newcounter\@gobble\let\setcounter\@gobbletwo
  \globaldefs\@ne \let\c@loldepth\@ne
  \newlistof{listings}{lol}{\lstlistlistingname}
  \newlistentry{lstlisting}{lol}{0}
\endgroup

Now one can customize the appearance of entries in the list of listings with commands of the form \cftlstlisting...; these should typeset the list of listings exactly as the others.

\renewcommand{\cftlstlistingdotsep}{\cftnodots}
\renewcommand{\cftlstlistingleader}{\tocEntryPageSep}
\renewcommand{\cftlstlistingafterpnum}{\cftparfillskip}
\renewcommand{\cftlstlistingpagefont}{\tocPageStyle}

In the case of memoir no vertical adjustment at the beginning of the lists seems to be necessary.

Addition

In order to add a separation in the "list of listings" for listings in different chapters, do

\makeatletter
\renewcommand*{\insertchapterspace}{%
  \addtocontents{lof}{\protect\addvspace{10pt}}%
  \addtocontents{lot}{\protect\addvspace{10pt}}%
  \addtocontents{lol}{\protect\addvspace{10pt}}}
\makeatother

or, more simply,

\makeatletter
\g@addto@macro\insertchapterspace
  {\addtocontents{lol}{\protect\addvspace{10pt}}}
\makeatother

put this before \begin{document}

\makeatletter
    
\let\l@lstlisting\l@section
    
\makeatother 
    

The titletoc package works for any contents generated by \contentsline and \numberline. For a new type of contents, just use

\contentsuse{<content type>}{<content file extension>}

Then we can use \titlecontents command to customize the list just like ToC/LoF/LoT's. It's much easier than patching tocloft package.

And here is an example for \lstlistoflistings:

\documentclass{article}
\usepackage{listings}
\usepackage{titletoc}

\contentsuse{lstlisting}{lol}
\titlecontents{lstlisting}[2em]
              {\addvspace{0.25pc}}
              {\textbf{Code \thecontentslabel} }
              {}
              {\titlerule*[0.5em]{$\cdot$}\contentspage}
              []

\begin{document}

\lstlistoflistings

\begin{lstlisting}[caption=Test]
Some code
\end{lstlisting}

\end{document}