Theoretical study of heteroatom-containing compounds. From aromatic and polycyclic molecules to hollow cage clusters