On the electrostatic potential and charge of cosmic grains. III - Grains in diffuse and dense interstellar clouds