Next-Generation Wireless Systems for Joint Communication and Sensing in Millimeter-Wave and Terahertz Spectrum