Typically, the qemu device will use the "chardev" abstraction to get data from a socket on the host. For example, something like -chardev socket,path=/tmp/foo.sock,server,nowait,id=foo -device myi2c,chardev=foo
will connect your i2c device to a socket on the host.
There are many examples of devices that use chardevs in QEMU's hw/char directory. A simple example is digic-uart.c.