For any CW complex $X$ one defines a chain complex $C_*(X)$: choose an orientation of each cell; the group $C_n(X)$ is the free abelian group with a basis whose elements correspond to the $n$-cells of $X$ and the differential $C_n(X)\to C_{n-1}(X)$ is defined by $c\mapsto \sum_{c'\in\partial c} (c,c')c'$ where $(c,c')$ is the incidence number of $c$ and $c'\in\partial c$ defined as follows.
By the definition of a CW complex one can extend the homeo of an open $n$-ball to $c$ to a map of the closed ball; take the preimage of $c'$ under the resulting mapping $S^{n-1}\to X$. We get a finite number of disks in $S^n$, some of which are positively oriented and some are negatively oriented (the sphere is oriented by the rule "outgoing normal first"); the incidence number of $c$ and $c'$ is the sum of the signs of the disks.
This generalizes the chain complex of a simplicial set. The homlogy of $C_*(X)$ is isomorphic to the singular homology of $X$, see e.g. Hatcher, Algebraic topology, p. 137 (freely available online) or Milnor, Stasheff, Characteristic classes, Appendix A.