You can find the comparison here. Seach for "Model comparison"
https://www.cisco.com/c/en/us/products/collateral/routers/network-convergence-system-500-series-routers/datasheet-c78-740296.html
About the licensing, in "Software feature support on NCS 540 in Cisco IOS XR:" you can see support to L3 protocol and any special licensing is mentioned.
About the interface, they present this option: 24x1/10GE, 8x10/25GE, 2x100GE. they dont mention 40GE specifically but you can get 40 with 4 interfaces of 10GE.