BPS spectra and non-perturbative gravitational couplings in N = 2, 4 supersymmetric string theories