This is the code I use in conjunction with the
1) Advanced Custom Fields WordPress plugin - http://www.advancedcustomfields.com/
2) The tevko responsive image plugin - https://github.com/tevko/wp-tevko-responsive-images
You will need to create an image field in ACF and be sure to set the 'return value' to Image ID.
(You can ignore the figure elements above, just left them in there to help give some context to the important code - from lines 3 to 10)
Some background on the tevko responsive image plugin: http://css-tricks.com/hassle-free-responsive-images-for-wordpress/#comment-1581891
Note that in this article Chris uses the old version of Picturefill, while the Tevko plugin now uses the Picturefill 2.0 code.