By performing large-scale first-principles density-functional theory and matrix Green's function calculations, we investigate the coherent charge transport properties of finite (8,0) and (10,0) single-walled carbon nanotubes (CNTs) end-contacted to Au(111) electrodes. We find that the device conductance varies significantly with the CNT diameter, and analyze its origin in terms of the charge transfer at the CNT-metal interfaces and the decay of metal-induced gap states. We thus provide an atomistic picture that explains the difficulty of constructing electronic devices based oil small-diameter CNTs in a reliable and controllable way. Computational improvements we have made for all efficient large-scale matrix Green's function calculation will also be described.