One way to do this is by tilting the lens. This causes the plane of focus to not correspond with the flat plane of the sensor, letting you change where the blur falls. You can buy specialized tilt-shift lenses, which are usually rather expensive and large, or you can try "freelensing", but I think the best combination of ease of use and budget is the series of lenses from Lensbaby.
These are designed to bend to provide exactly the effect you are looking for. Their cheaper designs, like the Spark and Muse are designed to be free-flowing and in-the-moment, and somewhat difficult to use in a repeatable way. The more expensive Composer models are designed with greater precision in mind (but aren't necessarily in inherently "better").
Each of these can take a variety of swappable optics, from all-plastic (or glass) single-element lenses up through the more multi-element, multi-coated "Sweet 35" design.
If this kind of effect is of interest to you, and you don't want the expense (or size and weight, or the need for careful adjustment for each shot), and you're interested in doing it in-camera rather than faking it in post-production, to me Lensbaby is the best answer.