It depends upon how sophisticated a solution you want to use.
Picasa 2 (I seem to recall) will do what you want for free but then there are the constraints of doing it as the program insists.
And, to be fair, it really is a wonderful feature for sure.
I don’t know your skills orn experience so apologies if this is well-known to you but in Photoshop a nice result can be obtained by selecting and saving foreground, mid ground and background to separate layers.
Each layer may be tweaked (sharpened, blurred, color shifted, … ) as required. It does take skill but after a few hours of daily practice I guess one will be pretty skilled at it after a week or two
ps – Gaussian blur and the other blur effects tend to emulate ‘out of focus’ sharpen seems to try to emulat ‘ in focus’