Converting and Subtracting Two Dates
Assuming that you have a valid reason to convert the date to a string, and that you cannot change that logic: declare yourself a variable to store the intermediate results of the date arithmetic before you convert it to a string, then you can easily get the difference between the two dates:

DECLARE @eom DATE 
      = DATEADD(m, DATEDIFF(m, 0, DATEADD(m, 1, DATEADD(MM, -1, @maxDwdate))), -1);
DECLARE @EndOfMonth AS VARCHAR(10)
    SET @EndOfMonth = (SELECT CONVERT(VARCHAR, @eom, 112))
 SELECT DATEDIFF(DAY, @eom, DUTEDATE) AS DAYS
   FROM t; -- replace with actual table name.