You can set the link distance as a function of the link data in a force layout. However, that will only be the "ideal" distance, and the actual distance will be affected by the other forces at work. In order to make the display distance closely match the ideal distance, you can also set the link strength to be 1 -- but even then you'll get some "springiness".
Example: http://jsfiddle.net/cSn6w/15/
var force = d3.layout.force()
.on("tick", tick)
.charge(-80)
.linkDistance(function(d){return d.target.dist * 100;})
.linkStrength(1)
.friction(0.95)
.size([w, h]);