John Lee's Introduction to Topological Manifolds defines the dimension of a CW complex $X$ as the largest dimension of a cell in $X$. The author claims "The fact that this well defined depends on the theorem of invariance of dimension."
I'm assuming he is referring to invariance of dimension for manifolds, since it's the only invariance of dimension result mentioned up to that point, but since not all CW complexes are manifolds, I don't immediately see how the proof would go. Is it meant to be easy, or does it take some more machinery?
I think John Lee meant to use the full power of invariance of domain. I don't think that it can be deduced simply from the fact that homeomorphic manifolds have equal dimensions (unless "invariance of dimension" means something else). I believe a stronger variant is needed, in particular that there is no continuous injective map $\mathbb{R}^n\to\mathbb{R}^m$ if $n>m$.
More generally, assume that $f:X\to Y$ is a homeomorphism between CW complexes, with fixed CW structures. Assume that $X$ has an $n$-cell. This means that we have an embedding of a closed ball $i:D^n\to X$. $D^n$ is compact and thus so is the image of $f\circ i$. In particular it has to be contained in a finite subcomplex $Y'$. Take an open cell $e$ of maximal dimension $m$ in $Y'$ which intersects the image of $i$ (such cell has to exist). First of all $e$ is homeomorphic to $\mathbb{R}^m$, as all open cells are. Secondly this cell is open in $Y'$, as all maximal open cells are. Thus $(f\circ i)^{-1}(e)$ is open in $D^n$, in particular it intersects the interior of $D^n$. And so we can restrict $i$ to an open ball, which is homeomorphic to $\mathbb{R}^n$. Combining everything together we obtain a continuous injective map $\mathbb{R}^n\to\mathbb{R}^m$, which by the invariance of domain can only happen when $n\leq m$.
Concluding: if $X$ contains a cell of dimension $n$, then $Y$ contains a cell of dimension at least $n$. For that we only need $f$ to be injective. The vice versa also holds when $f$ is a homeomorphism, because we can apply the previous result to $f^{-1}$, more precisely: if $Y$ contains a cell of dimension $m$ then $X$ contains a cell of dimension at least $m$. Both of course imply that they have equal dimension (finite or not), and so the dimension is a topological invariant.