We investigate a recently developed approach [P. L. Silvestrelli, Phys. Rev. Lett. 100, 053002 (2008); J. Phys. Chem. A 113, 5224 (2009)] that uses maximally localized Wannier functions to evaluate the van der Waals contribution to the total energy of a system calculated with density-functional theory. We test it on a set of atomic and molecular dimers of increasing complexity (argon, methane, ethene, benzene, phthalocyanine, and copper phthalocyanine) and demonstrate that the method, as originally proposed, has a number of shortcomings that hamper its predictive power. In order to overcome these problems, we have developed and implemented a number of improvements to the method and show that these modifications give rise to calculated binding energies and equilibrium geometries that are in closer agreement to results of quantum-chemical coupled-cluster calculations.