Secure Key exchange using javacard applet
Both RSA and DH have a similarity which is the Modulus Exponential (modexp) function (RSA encrypt/decrypt function). Since both RSA and DH uses the same modexp function, you can make full use of the Cipher for ALG_RSA_NOPAD in JavaCard's crypto API.

I have sat down and taken time to adapt the RSA crypto functions for traditional non-ECC type of DH functions and you can find the open source applet code here (https://github.com/ASKGLab/DHApplet/blob/master/src/dhapplet/DH.java).

I have not yet done up the APDU commands to create a full fledge demo but I guess if you study the DH.java codes, it should be more than enough to give you a head start. I have included a ton of commends in the source code on how to adapt it to different scenarios and the thought process as well when designing the entire DH class and it's significance.