You'll need to use the uasort function, which lets you specify a simple comparison function you write. See uasort for specifics. You can also define an anonymous function as part of the uasort call. Since you have an object with an array, make sure that you are passing the object's array to the uasort function. Since you're sorting an array of objects, your comparison function should take into account that it's working with 2 objects.
Building upon your responses and your var_dump:
uasort($foo[0]->products, function($a, $b) {
if ($a->created_at < $b->created_at) {
return -1;
}
return 1;
});