Real-time Green's-function theory is employed to describe nonequilibrium transport in the single-electron regime through a quantum well coupled to electron reservoirs modeling a lateral confined resonant-tunneling diode (RTD) in the single-electron regime. The reservoirs are held at thermal equilibrium with a finite temperature and chemical potential, given by a voltage source. Multiple subbands, electron spin, intrawell scattering, and Coulomb interaction are included. Using nonequilibrium Green's functions the steady-state current and particle number are studied. As a special case we present a derivation of the current-voltage characteristic of a conventional RTD that is exactly the same as in single-electron theory with optical potential. Numerical results are presented and the effects of confinement and coupling asymmetry are investigated. We show that in general the electron number in the well is not quantized and intrawell interaction cannot be described adequately by a classical capacity. \textcopyright{} 1996 The American Physical Society.