A Green's-function method has been used to study the surface and interface electronic structures of the II-VI compounds HgTe and CdTe. Localized surface and resonance states near the cation-terminated (100) surface of CdTe and the anion-terminated surface of HgTe have been found for the ideal surfaces. The energies and strengths of these surface states are altered by surface perturbations. The bulk states near the surface are drastically modified by the creation of the surface, but the band gaps remain unchanged. Numerical evaluation of the local densities of states at the Gamma and J points shows that, at the (100) interface of HgTe/CdTe, the previously observed surface states are no longer present. However, in the interface region, bulk states of one material penetrate some distance into the other material.