Resonant dipole-dipole interaction in the presence of dispersing and absorbing surroundings