Long winded, but here goes:

In order to understand torque and horsepower, you have to first look at the fundamentals. The most fundamental unit in mechanics (in the physics sense, not the car repair sense) is force, typically measured in pounds-force, and usually referred to as simply 'pounds'

In any machine, a certain force is required to overcome static friction and "get things going". After that, the force may be just sufficient to overcome running friction (example being the force applied by the drive axle to maintain a fixed "speed"; it is the force required to overcome friction and wind resistance.). Or, it may be sufficent to provide acceleration. No matter what scenario you analyze in automobile dynamics, it is the force applied to the vehicle by the drive axle that creates all changes in velocity. Large forces create rapid changes in velocity (high acceleration), lower forces create slower changes in velocity (lower acceleration). The net force available to change the vehicle's velocity is the force applied, minus the forces eaten up by friction and wind resistance.

What determines how much acceleration a given (net) force produces? Simply the mass (commonly called weight) of the vehicle. This is where f=ma comes in.

Now, if the machine is powered by a rotating prime mover, torque provides the force. Without torque (which is ultimately converted to a forward force where the "rubber hits the road"), the vehicle can experience no change in velocity. Any fixed value of torque developed in the engine results in a fixed forward force. The relationship between the torque and the force is determined by the transmission and rear axle gearing as well as the tire diameter. We will assume that the tire has enough grip to transfer the force effectively.

Since torque determines force, and since force and weight determines acceleration, torque and weight determines acceleration. Period.

So where does horsepower fit in? Well, so far we have ignored work. Work is simply a force applied over a given distance. If our engine's torque provides a 100 pounds of forward force for 10 feet, the engine has done 1000 foot-pounds of work. The torque provided the effort, but didn't care for how long or how far. It didn't even care if the vehicle moved or not, the torque and force were still developed. If the car didn't move, though, the engine didn't do any work (except for the oil pump, alternator, water pump, etc.).

Horsepower is simply a measure of fast an engine can perform a given amount of work. It is defined as 550 ft-lbs/sec. As an example, (ignoring losses), 100 horsepower can move an object 100 feet each second while delivering a force of 550 lbs. Stated another way, it is how fast the force can move along.

So heres the relationship:
Torque determines the force, horsepower determines at what rate the force can be moved along. Horsepower is the result of torque and motion, and does not exist unless both are present. You can think of it as a measure of how effectively the torque is being put to good use.

Two engines capable of the same horsepower may develop it in different ways. The truck engine delivers a huge amount of torque and provides a huge amount of force. It can do a lot of work, but its low rotational speed limits the rate at which it can perform the work. A high performance car engine delivers much lower torque and force, but can move that force along at a much greater rate. Geared down, it will proved the same amont of torque, hence force, hence acceleration as the truck engine. And vice versa.