A transferable tight-binding potential has been constructed for heteroatomic systems containing carbon and hydrogen. The electronic degree of freedom is treated explicitly in this potential using a small set of transferable parameters which has been fitted to small hydrocarbons and radicals. Transferability to other higher hydrocarbons were tested by comparison with ab initio calculations and experimental data. The potential can correctly reproduce changes in the electronic configuration as a function of the local bonding geometry around each carbon atom. This type of potential is well suited for computer simulations of covalently bonded systems in both gas-phase and condensed-phase systems.