Scanning tunneling microscopy and spectroscopy of topological materials and heterostructures in thin films and devices