The role of Coulomb interaction in the superconducting properties of CaC6 and H under pressure