\documentclass{article}
\makeatletter
\def\theindex{%    only for demonstration
  \section*{\indexname}
  \parskip\z@ \@plus .3\p@\relax \parindent\z@
  \let\item\@idxitem}
\makeatother
%StartVisiblePreamble
\makeatletter
\g@addto@macro{\theindex}{%
  \pagestyle{empty}%
  \def\subsubsubitem{\@idxitem\hspace*{35\p@}}
  \def\subsubsubsubitem{\@idxitem\hspace*{40\p@}}
}
\makeatother
\usepackage{makeidx}\makeindex
%StopVisiblePreamble
\begin{document}
foo\index{foo} bar\index{foo!bar}
baz\index{foo!bar!baz} foobar%
\index{foo!bar!baz!foobar} Kuba
\index{foo!bar!baz!foobar!Kuba}
\newpage \printindex
\end{document}
