Invariant operators of IU(n) and IO(n) and their eigenvalues