Impurity states and interlayer tunneling in high temperature superconductors