The growing interest towards ultra-wideband (UWB) communications stems from its unique features such as baseband operation, ample multipath diversity, and the potential of enhanced user capacity. But since UWB has to overlay existing narrowband systems, multiple access has to be achieved in the presence of narrowband interference (NBI). However, existing baseband spreading codes for UWB multiple access are not flexible in handling NBI. In this paper, we introduce two novel spreading codes that not only enable baseband UWB multiple access, but also facilitate flexible NBI cancellation. We construct our codes using a single carrier or multiple carriers (SC or MC), which can be implemented with standard discrete-cosine transform (DCT) circuits. With our SC/MC codes, NBI can be avoided by simply nulling undesired digital carriers. Being digital, these SC/MC codes give rise to multi-band UWB systems, without invoking analog carriers. In addition, our SC/MC codes enable full multipath diversity, and maximum coding gains. Equally attractive is their capability to reduce the number of interfering users, with simple matched filter operations. Comprehensive simulations are also carried out to corroborate our analysis.