A few examples & short tutorials on motion tracking & text in After Effects.
Kevin-Tod-Haug‘s title design for David Fincher‘s film Panic Room (2002) comprises text floating above, while seemingly connected to, real-world buildings, as the camera pans and tilts across cityscapes (via Art of the Title):
2D motion tracking
Every Frame a Painting looks at ways motion tracking and type are used to make texting more visually interesting in the series Sherlock:
Some better-known examples of motion tracking and graphic overlays in modern movies can be found in the MCU. MJake breaks down the combination of static images, effects and nested compisitions that goes into Doctor Strange‘s shield effect:
3D motion tracking