  We calculate the cohomology spaces of the Hilbert schemes of points on
surfaces with values in locally constant systems. For that purpose, we
generalise I. Grojnoswki's and H. Nakajima's description of the ordinary
cohomology in terms of a Fock space representation to the twisted case. We
further generalise M. Lehn's work on the action of the Virasoro algebra to the
twisted case.
  Building on work by M. Lehn and Ch. Sorger, we then give an explicit
description of the cup-product in the twisted case whenever the surface has a
numerically trivial canonical divisor.
  We formulate our results in a way that they apply to the projective and
non-projective case in equal measure.
  As an application of our methods, we give explicit models for the cohomology
rings of the generalised Kummer varieties and of a series of certain even
dimensional Calabi--Yau manifolds.
