Denim giant VF Corp has agreed to buy youth-oriented apparel and footwear company Vans Inc for about $396 million.