Here is solution for days:
http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2
In the same post but in the comments I unswered how to calculate months:
http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/#comment-23
The real problem in month difference calculation is it can't be determined precisely if each date is not equal 1st of a month.
http://alecpojidaev.wordpress.com