The coronavirus disease 2019 (COVID-19) epidemic had a momentous influence on the state of universal health and how people live their lives in every nation. The combination of the Internet of Things (IoT) with medical systems is referred to as the "Internet of Medical Things (IoMT)," and it makes it possible for various medical events to take place, including real-time medicine prescriptions, remote patient observing, and real-time diagnosis, amongst other things. However, the security, integrity, and concealment of medical data on the IoMT remain an endless issue, contributing to the difficulties that arise in providing medical services. However, these conventional methods failed to provide robust security against attacks like distributed denial of service (DDoS). As a result, security IoMT-based COVID-19 detection applications are required. Therefore, this article proposes a novel IoMT-based COVID-19 detection and classification network (ICDC-Net) for smart healthcare applications. Initially, Optimal Feistel Block Cipher (OFBC) encryption was performed on COVID-19-based medical data (chest x-ray images), which provides the highest security to the patient's data. Here, OFBC loss is optimized by the Hybrid Grey-Wolf Optimizer with Particle Swarm Optimization (HGWO-PSO), which performs DDoS attack detection and prevention. Further, the HGWO-PSO is also used to extract disease-specific features from the COVID-19 chest X-ray (CXR) images. Finally, the Residual Network50 (ResNet50) deep learning model is used to classify multiple diseases from CXR images, including normal, COVID-19, and viral pneumonia. The simulations disclosed that the proposed ICDC-Net resulted in improved attack detection accuracy (ADA), attack detection time (ADT), and reduced attack detection error rates (ADER) as compared to other security standards. Further, the simulations also disclosed that the proposed ICDC-Net developed superior COVID-19 categorization performing as equated to existing classification prototypes.