A greater understanding of the physics involved is required here, both in the initial question and in many of the above answers, which I don't feel have adequately addressed the issue.
Objects in space will orbit around the largest nearby gravitational source (although forces from other distant objects still play a factor). Planets and comets orbit the sun in heliocentric orbits, while most satellites orbiting the earth (including the moon and some space dust) are in geocentric orbits.
Most orbits are elliptical to some degree: orbits such as the earth around the sun are mostly circular, while comets are typically highly elliptical.
It is more convenient to use a polar coordinate system when examining orbits. More detail can be found Here, however the basics are as follows:
Focusing on a specific object as an example (such as the international space station), two forces are responsible for the curved nature of the orbit. Namely:
A normal force. This is the acceleration due to gravity, and is treated as a straight line between the satellite and the earth. It is this force which is responsible for the orbit being curved around the body at its center.
A tangential force. This is in the direction of travel.
In the case of a satellite launched from earth, the rocket initially accelerates vertically from the surface. However shortly after launch, the rocket curves over, until (once in space) it is flying parallel to the earth's surface. It then continues to accelerate until the tangential speed is high enough to prevent it from falling back to earth. Typically once in orbit, the engines are shut down: orbiting is purely due to conservation of momentum: I'll get to why this isn't entirely true below, but this is sufficient for now.
If the rocket keeps accelerating (due to engine thrust) the orbit around the earth will become more elliptical, until eventually it reaches escape velocity and is travelling fast enough to escape earth's orbit and become heliocentric. Once orbiting the sun, the engines are again shut down: orbit is once again purely due to conservation of momentum.
Such a satellite would be orbiting the sun, but with an orbit which would be very similar to the earth's. If the satellite/probe then wants to travel to another planet (such as mars) it will again accelerate (engines) to enlarge the orbit until it's close enough to mars to be influenced by that planet's gravity. To actually orbit, or land on mars, it then needs to decelerate (usually by turning until the engines face forward or by using retro-rockets) until it enters a mars orbit. Perhaps a better explanation (with pictures) is here.
At this point, hopefully this explains the larger celestial bodies: both planets and comets orbit the sun, although the latter usually have highly elliptical orbits. The 'curved' nature of both orbits is entirely due to the sun's gravity; neither planets nor comets need any thrust to continue on their path.
Similarly with rockets/satellites/the space shuttle, no additional engine thrust is needed to continue orbiting the earth: any movies showing spaceships with engine glow/flames are purely there for special effects (unless the craft is actually adjusting its orbit).
As I mentioned above, this explanation neglects one factor: drag.
Around most planets (particularly the earth), there is an atmosphere, consisting of gas particles. In the case of earth, 'space' is typically defined as about 100km above the surface (the Kármán line), however the transition from 'atmosphere' to 'space' isn't a hard line; atmospheric particles around the earth exist as high as the edge of the thermosphere, about 690km above the surface. This is actually above the orbit of the moon, and well above the height of most geocentrically orbiting satellites (such as the ISS).
The significance of this is that as the satellite orbits, it collides with these atmospheric particles. These collisions produce drag, slowly reducing the tangential velocity, and causing the orbit to slowly decay until it re-enters the atmosphere. This is the reason that satellites eventually fall back to earth: the first artificial, man-made satellite (Sputnik 1) only stayed in space for about 3 months before it was burned up re-entering the atmosphere.
So this is where the caveat is: all satellites around the earth (below about 690km) experience drag and have decaying orbits. In the case of the ISS (orbiting approximately 400km away), the orbit decays, and so the station periodically needs a 'push' to remain in space. This push used to be performed by the space shuttle before it was retired: after the shuttle docked with the station for crew/supply transfers, it would typically fire it's engines to provide this push to keep the ISS in a stable orbit. Then it would detach and return to earth (using its thrusters for a retro-burn).
Part of the recent plans to decommission the ISS were due to there being no suitable tug to keep it in orbit after the retirement of the shuttle: one of my colleagues did his PhD on analysing how the ISS would burn up on re-entry.
So the only time a spacecraft needs to use its engines in space is for a) changing its orbit/flying to another planet, or b) overcoming atmospheric drag to prevent the orbit decaying.
The rest of the time, it is coasting with the engines off.
As one final point; space above 690km isn't entirely empty: solar particles and bits of dust are present throughout the entire solar system, out to beyond the orbit of pluto (see Heliosphere). Both Voyager 1 and 2 have left this region. So even comets will experience some (negligible) drag: I include this point that 'space' isn't completely empty for completeness.