In this article, a pen-type device that enables three-dimensional (3D) human-computer interaction is presented. This device is based on a high-precision 3D ultrasonic (US) positioning method, which can achieve millimeter-level accurate 3D positioning and six degrees of freedom (6DoF) within a working range of 4 m × 1.5 m × 1.5 m. The 3D positioning of the electronic pen is realized by a highprecision time-of-flight (TOF) detection method based on dynamic thresholding and zero-crossing detection as well as a multigroup positioning coordinate averaging method. During the 3D positioning process, correlation filtering is adopted to process the received US signals and suppress any interference signals below 20 kHz and above 60 kHz. The positioning method can achieve a high positioning accuracy without any complex calculations. The attitude of the electronic pen is measured using an inertial measurement units (IMUs). To demonstrate the positioning accuracy of the proposed device, a total of 108 test positions are uniformly set in the workspace, and static and dynamic positioning accuracy experiments are carried out at all test positions. The experimental results show static and dynamic positioning errors of less than 0.35 mm and less than 1.0 mm, respectively, which indicate a high positioning accuracy. The proposed device can provide 6DoF and enable writing in 3D. Therefore, the device can meet the common requirements of a 3D human-computer interaction interface.