Links to above mentioned apps & handlers:
Erocm123:
App: https://github.com/erocm123/SmartThingsPublic/blob/master/smartapps/erocm123/virtual-physical-switch-sync.src/virtual-physical-switch-sync.groovy
Handler: https://github.com/erocm123/SmartThingsPublic/blob/master/devicetypes/erocm123/generic-dual-relay.src/generic-dual-relay.groovy
Pukkahq:
App: https://github.com/Pukkahq/SmartThings/blob/master/Fibaro%20FGS-222%20APP
Handler: https://github.com/Pukkahq/SmartThings/blob/master/Fibaro%20FGS-222
Fuzzsyb:
App: https://github.com/fuzzysb/SmartThings/blob/master/SmartApps/fuzzysb/Fibaro%20Dual%20Relay%20Secondary%20Switch%20Binder/FibaroDualRelaySecondarySwitchBinder.groovy
Handler: https://github.com/fuzzysb/SmartThings/blob/master/DeviceTypes/fuzzysb/Fibaro%20Dual%20Relay/FibaroDualRelay.groovy
FAQ smartapps & device handlers
FAQ: An Overview of Using Custom Code in SmartThings