Probably be hard to explain but what would work (working from the hub out) is a fixed freewheel attached to the hub then somehow have a bearing attached to it or the axle that the sprocket rides on. A "drive plate" would be attached to the fixed freewheel and the sprocket would attach to the bearing. Next would be an engage plate that had a series of pins that would go through the sprocket and into holes in the drive plate. The engage plate could be actuated by a pickle fork system similar to a clutch fork on a car.
Makes sense in my head.