please see this blog entry: http://elderec.org/2012/02/scripting-delete-files-and-folders-older-than-x-days/
Your command is ok for files, for folders you need to do another command:
forfiles -p "D:\Testing\Sample" -d -10 -c "cmd /c IF @isdir == TRUE rd /S /Q @path"