The von Neumann theorem states that for any symmetric operator $f$, the domain $D_{f^\dagger}$ of its adjoint $f^\dagger$ is the direct sum of the three subspaces $D_{\bar{f}}$, $\aleph_z$, and $\aleph_{\bar{z}}$.
The question is, $D_{\bar{f}}$ is already dense, therefore, its orthogonal complement is null.
So, it seems that while it is impossible to have a nontrivial orthogonal complement to a dense subspace, it is possible to have a nontrivial direct sum decomposition involving a dense subspace.
Can anyone give an example? The infinite space is so different from the finite dimensional spaces.
Take two lineraly independent discontinuous linear functionals $f,f'$. The intersection $I=H\cap H'$ of their kernels is dense of codimension $2$. If you take a vector $X$ that is in the kernel $H$ of the first linear functional and not in $H'$, then $$I\oplus \Bbb R X=H$$ and both $I$ and $H$ are dense.