In this paper, we present an efficient computational methodology for diffusion and convection-diffusion problems in highly heterogeneous media as well as convection-dominated diffusion problem. It is well known that the numerical computation for these problems requires a significant amount of computer memory and time. Nevertheless, the solutions to these problems typically contain a coarse component, which is usually the quantity of interest and can be represented with a small number of degrees of freedom. There are many methods that aim at the computation of the coarse component without resolving the full details of the solution. Our proposed method falls into the framework of interior penalty discontinuous Galerkin method, which is proved to be an effective and accurate class of methods for numerical solutions of partial differential equations. A distinctive feature of our method is that the solution space contains two components, namely a coarse space that gives a polynomial approximation to the coarse component in the traditional way and a multiscale space which contains sub-grid structures of the solution and is essential to the computation of the coarse component. In addition, stability of the method is proved. The numerical results indicate that the method can accurately capture the coarse behavior of the solution for problems in highly heterogeneous media as well as boundary and internal layers for convection-dominated problems.