Green's function calculations of the hyperfine interaction for impurities in metals andfor metallic interfaces