We compute the Nekrasov partition function of gauge theories on the (resolved) toric singularities C 2 /Γ in terms of blow-up formulae. We discuss the expansion of the partition function in the ǫ 1 , ǫ 2 → 0 limit along with its modular properties and how to derive them from the M-theory perspective. On the two-dimensional conformal field theory side, our results can be interpreted in terms of representations of the direct sum of Heisenberg plus W N -algebrae with suitable central charges, which can be computed from the fan of the resolved toric variety. We provide a check of this correspondence by computing the central charge of the two-dimensional theory from the anomaly polynomial of M5-brane theory. Upon using the AGT correspondence our results provide a candidate for the conformal blocks and three-point functions of a class of the two-dimensional CFTs which includes parafermionic theories.