You can use the command system_profiler SPUSBDataType
from a shell to list the USB information, including the serial number of an attached iPhone - you could parse this.
USB Hi-Speed Bus:
Host Controller Location: Built-in USB
Host Controller Driver: AppleUSBEHCI
PCI Device ID: 0x0aa6
PCI Revision ID: 0x00b1
PCI Vendor ID: 0x10de
Bus Number: 0x24
iPhone:
Product ID: 0x12a8
Vendor ID: 0x05ac (Apple Inc.)
Version: 6.02
Serial Number: 797296a8472XXXXXXXXXf5806511452228ac9
Speed: Up to 480 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x24300000 / 3
Current Available (mA): 500
Current Required (mA): 500
Extra Operating Current (mA): 500
To get things like the IMEI you will need to communicate with the actual phone, probably using IOUSBLib and you will need to do a lot of research on the USB primitives supported by the iPhone as I don't know how well documented they are.
It is probably easier to use a commercial Mobile Device Management (MDM) platform.