Multiscale partial differential equations (PDEs) are difficult to solve by traditional numerical methods due to the need to resolve the small wavelengths in the media over the entire computational domain. We develop and analyze a Finite Element Heterogeneous Multiscale Method (FE-HMM) for approximating the homogenized solutions of multiscale PDEs of elliptic, parabolic, and hyperbolic type. Typical multiscale methods require a coupling between a micro and a macro model. Inspired from the homogenization theory, traditional FE-HMM schemes use elliptic PDEs as the micro model. We use, however, the second order wave equation as our micro model independent of the type of the problem on the macro level. This allows us to control the modeling error originating from the coupling between the different scales. In a spatially fully discrete a priori error analysis we prove that the modeling error can be made arbitrarily small for periodic media, even if we do not know the exact period of the oscillations in the media. We provide numerical examples in one and two dimensions confirming the theoretical results. Further examples show that the method captures the effective solutions in general non-periodic settings as well.