For Vagrant itself, there is built-in support:
Vagrant.require_version ">= 1.3.5"
For Virtualbox, you can run some code at the top of your Vagrantfile like this:
if Gem::Version.new(`VBoxManage --version`.strip) <
Gem::Version.new('5.1.6')
abort "Please upgrade Virtualbox to 5.1.6 or later!"
end