A nanostructured thermoelectric device is designed by connecting a double-barrier resonant tunneling heterostructure to two electron reservoirs. Based on Landauer’s equation and Fermi-Dirac statistics, the exact solution of the heat flow is calculated. The maximum power output and efficiency are calculated through the optimizations of several key parameters. The optimum characteristic curve of the performance is obtained. The reasonably working region of the device is determined, the selection criteria of main parameters are provided, and the optimum configuration of the device is drawn. Results show that the heterojunction becomes a perfect energy filter by appropriately regulating the chemical potentials of electron reservoirs and optimally choosing the widths of barrier and quantum well and the nanostructured thermoelectric device with resonance tunneling may obtain simultaneously a large power output and a high efficiency.