Thanks to caskey for pointing me in the right direction. In case someone else needs the same functionality, here is the function that converts a path to a device:
#include <libudev.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <string>
std::string getPhysicalDiskSerialNumber(const char *path) {
struct stat s;
char syspath[256];
syspath[0] = '\0';
stat(path,&s);
sprintf(syspath,"/sys/dev/block/%d:%d",major(s.st_dev),minor(s.st_dev));
struct udev *context = udev_new();
struct udev_device *device = udev_device_new_from_syspath(context, syspath);
const char *id = udev_device_get_property_value(device, "ID_SERIAL");
std::string serial = id;
// Cleanup
udev_device_unref(device);
udev_unref(context);
return serial;
}