We study the non-perturbative behaviour of superconformal gauge theories with rigid N=2 supersymmetry in four dimensions, in particular N=2* theories, and discuss the relation between their S-duality properties and the possibility of computing exact quantum observables. For these theories in fact, the prepotential function, that encodes the low-energy effective dynamics on the Coulomb branch of moduli space, and the chiral correlators obey a modular anomaly equation whose validity is related to S-duality. This fact allow one to write them in terms of (quasi)-modular forms, thus resumming all instanton contributions. The results can be checked against the microscopic multi-instanton calculus in the case of classical algebras, but are valid also for the exceptional algebras, where direct computations are not available. We also comment on the extension of these techniques to configuration of 4-dimensional N=2 gauge theories in presence of 2-dimensional defects.