If you noticed those id="TheObjectLabel" attributes in Figures, tables and code listing you have already understood half of how cross-reference works.
Those id="something" attributes are unique labels identifying those objects. The other half of the task is understand how to use them for actual referencing.
This is done via a plain <xref linkend="TheObjectLabel"/>.
Since labels are to be UNIQUE it is adviceable to follow the guidelines provided in the relative appendix Appendix C.