We present an efficient implementation for the calculation of maximally localized Wannier functions (MLWFs) during parallel Car-Parrinello molecular dynamics simulations. The implementation is based on a block Jacobi method. The calculation of MLWFs results in only a moderate (10%-20%) increase in computer time. Consequently it is possible to calculate MLWFs routinely during Car-Parrinello simulations. The Wannier functions are then applied to derive molecular dipole moments of dimethyl sulfoxide (DMSO) in gas phase and aqueous solution. We observe a large increase of the local dipole moment from 3.97 to 7.39 D. This large solvent effect is caused by strong hydrogen bonding at the DMSO oxygen atom and methyl groups. Decomposing the dipole moment into local contributions from the S-O bond and the methyl groups is used to understand the electrostatic response of DMSO in aqueous solution. A scheme is given to derive charges on individual atoms from the MLWFs using the D-RESP methodology. The charges also display large solvent effects and give insight into the transferability of recent force field models for DMSO.