In this paper we investigate the electronic and optical dielectric properties of lateral and vertical heterostructures composed of two-dimensional (2D) ZrS2 and HfS2 monolayers based on density functional theory. First, we show that the bulk and monolayer ZrS2 and HfS2 as well as the vertical (ZrS2)m/(HfS2)n heteroestructures are indirect band gap semiconductors, while the lateral heterostructures exhibit an indirect to direct bandgap transition. Then we demonstrate that the optical properties of the bulk and monolayer HfS2 and ZrS2 are strongly anisotropic, for the bulk HfS2 and ZrS2, the in-plane components of the dielectric function is negative in a certain frequency band, where they can work as naturally hyperbolic metamaterials (HMMs). Interestingly, the vertical heterostructures also possess a hyperbolic region, whose position and width can be tunable with the thickness ratio of constituents. It is also found that the (ZrS2)/(HfS2) vertical heterostructures can enhance spontaneous emission and about 100-fold improvement of the Purcell factor is obtained. These results prove the feasibility of 2D material heterostructures to realize tunable hyperbolic metamaterials, the heterostructures present a promising opportunity for the practical applications in light-generation technologies.