Theory of hybrid quantum systems