For OS X we have the Tun/TAP driver that allows us to create tap interfaces and configure them accordingly. http://tuntaposx.sourceforge.net/
The openVPN connect client seems to be using a tap interface on iOS 7, but couldn't find any documentation that gives an indication of how this can be done.
There is the Network Extensions framework in iOS 8, but is poorly documented. Found a really nice blog explaining how to use this framework to create on demand VPN connections on iOS 8: http://ramezanpour.net/post/2014/10/15/create-an-on-demand-vpn-connection-programmatically-in-ios-8/
I haven't gone through the header files yet (which is the only documentation available), but looks like it exposes creation of VPN interfaces (not generic tunnel interfaces) for IPSec and L2TP. So internally it might be creating tunnel interfaces. However, couldn't figure if we can use this API to create generic tunnel interfaces.