Dually the story is also very beautiful. Instead of spaces mapping into a reasonable space $X$, one can look at mappings of $X$ into spaces. Of course for any space $Y$ the homotopy classes $ X\rightarrow Y$ is a homotopy invariant for $X$. But this is very hard to compute in general, because the set $[X,Y]$ does not have any structure. However, if the space(s) $Y$ have structure (e.g. they sit in a spectrum) much more structure is available, which allows one to compute these homotopy classes. This is the case for any (generalized) cohomology theory: This includes singular cohomology (maps into Eilenberg-Maclane spaces), $K$-theory (maps into Fredholm operators), cohomotopy (maps into spheres), bordism (maps into universal thom spaces) and much more. To obtain generalized homological invariants one can look at homotopy groups of $Y\wedge X$, which is not exactly what you asked.
There are also some general statements what $Y$ should be such that $[X,Y]$ and $[Y,X]$ form the structure of a group. This is what John Klein is alluding to above. I don't know too much many invariants that are used daily which do not arise in this manner (except maybe the Lyusternik-Schnirelmann category) which do not arise in this manner.