This paper presents a new method for the solution of multiscale stochastic differential equations at the diffusive time scale. In contrast to averaging-based methods, e.g., the heterogeneous multiscale method (HMM) or the equation-free method, which rely on Monte Carlo simulations, in this paper we introduce a new numerical methodology that is based on a spectral method. In particular, we use an expansion in Hermite functions to approximate the solution of an appropriate Poisson equation, which is used in order to calculate the coefficients of the homogenized equation. Spectral convergence is proved under suitable assumptions. Numerical experiments corroborate the theory and illustrate the performance of the method. A comparison with the HMM and an application to singularly perturbed stochastic PDEs are also presented.