  We consider surfaces with parallel mean curvature vector (pmc surfaces) in
$\mathbb{C}P^n\times\mathbb{R}$ and $\mathbb{C}H^n\times\mathbb{R}$, and, more
generally, in cosymplectic space forms. We introduce a holomorphic quadratic
differential on such surfaces. This is then used in order to show that the
anti-invariant pmc $2$-spheres of a $5$-dimensional non-flat cosymplectic space
form of product type are actually the embedded rotational spheres
$S_H^2\subset\bar M^2\times\mathbb{R}$ of Hsiang and Pedrosa, where $\bar M^2$
is a complete simply-connected surface with constant curvature. When the
ambient space is a cosymplectic space form of product type and its dimension is
greater than $5$, we prove that an immersed non-minimal non-pseudo-umbilical
anti-invariant $2$-sphere lies in a product space $\bar M^4\times\mathbb{R}$,
where $\bar M^4$ is a space form. We also provide a reduction of codimension
theorem for the pmc surfaces of a non-flat cosymplectic space form.
